<template>
	<div class="child">
		<h1>我是Child组件</h1>
		<h3>我有台电脑：{{computer}}</h3>
		<button @click="handleClick">点我把电脑交给父亲</button>
	</div>
</template>

<script>
	export default {
		name:'Child',
		data() {
			return {
				computer:'联想'
			}
		},
		methods:{
			handleClick(){
				this.$emit('haha',this.computer)
			}
		}
	}
</script>

<style>
	.child{
		background-color: skyblue;
		padding: 20px;
	}
</style>